<?php namespace Cribbb\Storage\Nerd;
 
use Nerd;

class EloquentNerdRepository implements NerdRepository {
 
	/**
	 * Retrieving All Models
	 */
	public function all()
	{
		return Nerd::all();
	}
	
	public function create($input)
	{
		return Nerd::create($input);
	}
	
	/**
	 * Retrieving A Record By Primary Key
	 */
	public function find($id)
	{
		return Nerd::find($id);
	}
	
	public function update($id, $input)
	{		
		$nerd = $this->find($id);
		$nerd->update($input);
		
 		return $nerd;
	}
	
	public function delete($id)
	{
		$nerd = $this->find($id);
	
		return $nerd->delete();
	}
}